<?php

class LanguageController extends AppController {

    public function index($lang) {
        $this->autoRender = false;
        $referer = $_SERVER['HTTP_REFERER'];
        Locale::set($lang);
        $this->redirect($referer);
    }

}

?>